package com.ylzr.dao.impl;

import com.ylzr.dao.UserDao;
import com.ylzr.domain.User;

import java.util.List;
import java.util.Map;
import java.util.Properties;

public class UserDaoImpl implements UserDao {
    public UserDaoImpl() {
        System.out.println("UserDaoImpl无参构造在容器中创建了（无参构造实例化）");
//      打印依次就代表执行依次  无参构造执行一次就代表该类创建一次
    }
    private String username;
    private int age;
    private List<String> strList; //里面的String就是泛型
    private Map<String,User> userMap; //key是string 值就是引用对象User
    private Properties properties;

    public void setProperties(Properties properties) {
        this.properties = properties;
    }

    public void setUserMap(Map<String, User> userMap) {
        this.userMap = userMap;
    }

    public void setStrList(List<String> strList) {
        this.strList = strList;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public void save(String name) {
//        System.out.println("姓名："+username+"=="+age);
        System.out.println(strList);
        System.out.println(userMap);
        System.out.println(properties);
        System.out.println(name+"run");
    }

















    /**
     * bean 标签生命周期的配置
     * init() 初始化方法 bean标签中对应的属性为 init-method
     * destroy()销毁方法 bean标签中对应的属性为 destroy-method
     */
    public void init() {
        System.out.println("初始化方法已执行");
    }
    public void destroy() {
        System.out.println("销毁方法已执行");
    }


}
